# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php82-pecl-zephir_parser
_extname=zephir_parser
pkgver=1.6.0
pkgrel=0
pkgdesc="Zephir Parser is a code parser, delivered as a C extension for the PHP 8.2 language - PECL"
url="https://pecl.php.net/package/zephir_parser"
arch="all"
license="MIT"
_phpv=82
_php=php$_phpv
depends="$_php-common"
makedepends="$_php-dev"
source="php-pecl-$_extname-$pkgver.tar.gz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir"/$_extname-$pkgver

build() {
	phpize$_phpv
	./configure --prefix=/usr --with-php-config=/usr/bin/php-config$_phpv
	make
}

check() {
	echo "$pkgver" > VERSION
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test TESTS="${TESTS:- --show-diff }"
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/$_php/conf.d
	install -d $_confdir
	echo "extension=$_extname" > $_confdir/$_extname.ini
}

sha512sums="
84195c5702a12b1c6f9f027d2d0651bc7fb762cf71f4c7b4c9bc36b35fb92db54b994f5d2b0502d21b1dd8bb03710a72e4f0790b621edd2c1c69a10043b5d2ad  php-pecl-zephir_parser-1.6.0.tar.gz
"
